﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class orgman_methods_new : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MasApp.BLL.Check.CheckLogin();
        tb_methodname.Focus();
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        string methodname = tb_methodname.Text;
        string description = tb_description.Text;
        string creator = Session["username"].ToString();
        int orgid = MasApp.BLL.Search.SearchOrgID(creator);

        MasApp.Model.method m = new MasApp.Model.method();
        m.Organizationid = orgid;
        m.Methodname = methodname;
        m.Description = description;
        m.Creator = creator;

        #region 处理显示
        if (MasApp.BLL.reg.AddMethod(m))
        {
            Label1.Text = "添加成功！<a href='editlist.aspx'> 添加等级尺度</a>。";
            MasApp.BLL.ResponseHelper.alert("添加成功！", "editlist.aspx");
        }
        else
        {
            Label1.Text = "添加失败了。";
        }
        #endregion
    }
}
